package com.jkc.xh.adapters;

import android.view.ViewGroup;

import com.jkc.xh.R;
import com.jkc.xh.adapters.core.BaseRecyclerAdapter;
import com.jkc.xh.adapters.viewholder.MyChooseItemView;
import com.jkc.xh.adapters.viewholder.MyChooseItemView_;
import com.jkc.xh.models.FavModel;

/**
 * Created by macintosh on 15/11/17.
 */
public class MyChooseAdapter extends BaseRecyclerAdapter<FavModel, MyChooseItemView> {

    @Override
    protected MyChooseItemView onCreateItemView(ViewGroup parent, int viewType) {
        return MyChooseItemView_.build(parent.getContext());
    }

    @Override
    protected void onBindView(MyChooseItemView itemView, FavModel orderModel, int position) {
        itemView.bind(orderModel);
    }

    public void setListener(OnViewClickListener listener) {
        addOnViewClickListener(R.id.btnRemove, listener);
        addOnViewClickListener(R.id.btnBuy, listener);
    }
}
